package com.msw.ssh.service;

import com.msw.ssh.dao.UserDao;
import com.msw.ssh.model.User;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.Date;

/**
 * @Author hadoop
 * @Date 2015/11/21.
 */

@Repository
public class UserService {

    @Resource
    private UserDao userDao;

    public void addUser()
    {
        User user = new User();
        user.setId("9");
        user.setName("user1");
        user.setPassword("password1");
        user.setCreateTime(new Date());
        user.setExpireTime(new Date());
        userDao.add(user);
    }

    public void findUser(String namingSqlId){
        User u = userDao.find(namingSqlId);
        System.out.println(u);
    }
}
